<body>
<input id="clicked">
<script>
  document.getElementById("clicked").addEventListener("mousedown", function () {
      window.alert("mousedown"); },
      false);
  document.getElementById("clicked").addEventListener('mouseup', function() {
      window.alert("mouseup"); },
      false);
  document.getElementById("clicked").addEventListener("click", function() {
      window.alert("clicked"); },
      false);
</script>
</body>
